You are here: 1. Distribution System > 1.9. REPORTS Menu > 1.9.2. Reports - Report Generator > 1.9.2.7. Report Generator - Edit Menu > Edit - Add Field > Adding Accumulator Fields
Adding Accumulator Fields

Accumulators are used to perform mathematical calculations on other fields. Accumulators can be used on groups of records or all records. You can accumulate numeric variables, alpha fields or calculation fields which exist on a report. For example:

Item

Cost

 

A

$150.00

 

B

$200.00

 

C

$50.00

 

D

$100.00

 

Total

$500.00

This is the accumulator field

As an example, accumulator fields are included in the Debtor Account Inquiry report.

Debtor Account Inquiry Report

You can double click on accumulator fields (e.g. ACC7) to view their details.

To add an accumulator field to a report:

  1. Display the Select Field Type screen.

Refer to "Edit - Add Field".

  1. Select the Accumulator option then select OK.

Micronet displays the Edit Accumulator screen.

 

Technical Tip

You can display this screen quickly by selecting the Accumulator Tool on the Report Generator toolbar and then clicking on the report where you want the accumulator field to be added.

  1. Complete the following fields:

 

Field

Value

 

Accumulator

Micronet displays the next number for the accumulator field in this report, e.g. ACC9. You can change this name if required.

 

File

Micronet displays the file which contains the accumulator field to be displayed. This depends on the report you are creating or editing.

 

Relation

Select a relation on which the accumulator is based, i.e. the field only appears when that relation is in use.

 

Variable

This is a numeric field which exists in the selected Relation. It can also be selected from the calculation fields. See this example:

Qty

Discount

Total Cost

Sell

1

0.00

10.00

15.00

1

0.00

28.00

48.00

 

0.00

38.00

63.00

The Total Cost denotes a calculation field where the Total Cost depends on Quantity, i.e. Item Cost x Quantity.

 

Width (Grid Units)

Enter the length of the field on the report in grid units. This defaults to the maximum size the field can be (as pre-set in Micronet).

 

Decimal

Enter the number of decimal places to be displayed.

 

Comma

Select Yes if you want commas inserted to break up numbers in thousands, or No if you don't.

 

Bracket

Select Yes if you want brackets inserted around negative numbers, or No if you don't.

 

Prefix Dollar

Select Yes if you want this field prefixed with a $ symbol, or No if you don't.

 

Type

Select the accumulator type, i.e. the calculation on which the accumulator is based. The number in brackets next to each accumulator type shows the value that would be returned based on the table at the start of this topic.

Options are:

  • Frequency - displays the number of items in the selected field (4, i.e. four items in the list)
  • Summation - displays the total value of items in the selected field ($500)
  • Average - displays the average value of the selected field ($125)
  • Minimum - displays the minimum value of the selected field ($50)
  • Maximum - displays the maximum value of the selected field ($200)
  • First - displays the first value of the selected field ($150)
  • Last - displays the last value of the selected field ($100)
  • Previous - displays the previous value of the selected field ($100)
  • 2nd Last - displays the second last value of the selected field ($50).

 

Control Level

Enter the control break level for the data to be displayed.

For more information about control breaks, refer to "Options - Control Breaks".

 

Justification

Select whether output is to be left justified, centred or right justified.

 

Print Logic

Enter any condition where the field is to be displayed if the condition is valid.

For example, this would be used in the invoice format where you only want the Sales Tax field to be shown if the debtor is a wholesale debtor. Therefore in the Print Logic field of the Sales Tax field on the report, you would enter:

DBT_RETAIL = =  'W'.

This will only print the field when the debtor is a wholesale debtor.

0 = Does not print

 

Accumulate if

Enter any condition where the record should be included in the accumulator.

 

Zero after use

Select Yes if you want the value to be initialised to zero after the accumulator has been displayed, or No if you don't.

 

Zero Break

Select Yes if you want the value to be initialised to zero after a break point, or No if you don't.

 

Under Line

Select whether you want a single or double line to be printed on the report before or after your text field, or select No for no line.

  1. Select the Accept button.

Micronet redisplays the Report Generator screen for the selected report. If you used the Accumulator Tool to insert the accumulator field, the field displays where you clicked.

If you used menu options to insert the accumulator field, Micronet displays a rectangle which moves with the cursor.

  1. Move the rectangle where you want your accumulator field to be printed and then click.

Micronet inserts the accumulator field on the report where you clicked.

  1. You can move the accumulator field by clicking the Select Tool on the Report Generator toolbar, clicking inside the field you just added and then dragging it to the required position on the report.

  1. To edit the field you just added, refer to "Edit - Edit Field".
  2. To delete the field you just added, refer to "Edit - Delete Field".